-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix port_getn
calling.
#1215
Merged
sunfishcode
merged 2 commits into
bytecodealliance:main
from
Berrysoft:fix-illumos-getn
Nov 13, 2024
Merged
Fix port_getn
calling.
#1215
sunfishcode
merged 2 commits into
bytecodealliance:main
from
Berrysoft:fix-illumos-getn
Nov 13, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thanks! |
sunfishcode
added a commit
that referenced
this pull request
Nov 13, 2024
The solarish [`port_getn` function] special-cases a `max` argument value of 0 to be a query of the number of events available. #1215 added a special-case to protect the code from doing a resize in that case. And in case users actually do want to do a query, this PR adds a new `port_getn_query` function that passes a zero. [`port_getn` function]: https://illumos.org/man/3C/port_getn
By the way, would you publish a new release for this fix? |
sunfishcode
added a commit
that referenced
this pull request
Nov 18, 2024
* Add a `port_getn_query` function. The solarish [`port_getn` function] special-cases a `max` argument value of 0 to be a query of the number of events available. #1215 added a special-case to protect the code from doing a resize in that case. And in case users actually do want to do a query, this PR adds a new `port_getn_query` function that passes a zero. [`port_getn` function]: https://illumos.org/man/3C/port_getn * Fix errors. * Update src/event/port.rs Co-authored-by: 王宇逸 <[email protected]> --------- Co-authored-by: 王宇逸 <[email protected]>
sunfishcode
pushed a commit
that referenced
this pull request
Nov 18, 2024
sunfishcode
added a commit
that referenced
this pull request
Nov 18, 2024
* Add a `port_getn_query` function. The solarish [`port_getn` function] special-cases a `max` argument value of 0 to be a query of the number of events available. #1215 added a special-case to protect the code from doing a resize in that case. And in case users actually do want to do a query, this PR adds a new `port_getn_query` function that passes a zero. [`port_getn` function]: https://illumos.org/man/3C/port_getn * Fix errors. * Update src/event/port.rs Co-authored-by: 王宇逸 <[email protected]> --------- Co-authored-by: 王宇逸 <[email protected]>
sunfishcode
pushed a commit
that referenced
this pull request
Nov 18, 2024
sunfishcode
added a commit
that referenced
this pull request
Nov 18, 2024
* Add a `port_getn_query` function. The solarish [`port_getn` function] special-cases a `max` argument value of 0 to be a query of the number of events available. #1215 added a special-case to protect the code from doing a resize in that case. And in case users actually do want to do a query, this PR adds a new `port_getn_query` function that passes a zero. [`port_getn` function]: https://illumos.org/man/3C/port_getn * Fix errors. * Update src/event/port.rs Co-authored-by: 王宇逸 <[email protected]> --------- Co-authored-by: 王宇逸 <[email protected]>
This is now fixed in rustix 0.38.41. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
max
passed toport_getn
should be the capacity of the buffer, not the length.If
max
is zero,nget
is the events avaliable in the port. Then the calling toset_len
will be unsound.Ref: https://illumos.org/man/3C/port_getn